package com.contextor.magiccards.services.battle.impl;

import com.contextor.magiccards.dao.battle.BattleDao;
import com.contextor.magiccards.dao.utils.Pager;
import com.contextor.magiccards.model.battle.Battle;
import com.contextor.magiccards.model.battle.BattleStatus;
import com.contextor.magiccards.model.character.Personage;
import com.contextor.magiccards.model.user.User;
import com.contextor.magiccards.services.BaseService;
import com.contextor.magiccards.services.battle.BattleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * User: Sergey
 * Date: 20.03.2011 11:12:28
 */
@Service
class BattleServiceImpl extends BaseService<Battle, BattleDao> implements BattleService {

    @Autowired
    public BattleServiceImpl(BattleDao dao) {
        super(dao);
    }

    public Battle findOwnerWithStatus(User user, BattleStatus status) {
        return dao.findWithStatus(user, status);
    }

    public List<Battle> findWithStatus(int shard, String uid, BattleStatus status, Pager pager, Personage personage) {
        return dao.findWithStatus(shard, uid, status, pager, personage);
    }

}
